package com.zrrd.io.bufferedStream;

import java.io.BufferedWriter;
import java.io.FileWriter;

/**
 * @author WanJl
 * @version 1.0
 * @title BufferedWriterDemo01
 * @description 缓冲字符输出流  写
 * @create 2023/10/14 19:06
 */
public class BufferedWriterDemo01 {

    public void write(String fileName,String content) throws Exception {
        BufferedWriter bw = new BufferedWriter(new FileWriter(fileName));

        //写数据
        bw.write(content);

        bw.close();
    }


    public static void main(String[] args) throws Exception {
        BufferedWriterDemo01 writerDemo01 = new BufferedWriterDemo01();
        String c="laksdlksajkldasjkldajkledjalik" +
                "lkajsdlkajkld \n" +
                "alksjdlkajsdlkjakl\n" +
                "asdadasd";
        writerDemo01.write("D:/abc.txt",c);
    }
}
